package controllers

import javax.inject.Inject
import play.api.libs.json.Json
import play.api.mvc.{AbstractController, ControllerComponents}
import utils.TableUtils

class TreeController @Inject()(cc:ControllerComponents) extends AbstractController(cc) {

  def tree = Action { implicit request =>
    Ok(views.html.english.tree.tree())
  }

  def getTreeJson = Action {
    val nodes = TableUtils.treeData
    Ok(Json.toJson(nodes))
  }

}
